// 用户状态修改
import request from "@/utils/request";

export function changeBotStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/bot/enable',
    method: 'put',
    data: data
  })
}

export function getList(params) {
  return request({
    url: '/bot',
    method: 'get',
    params: params
  })
}
export function getOneById(id) {
  return request({
    url: '/bot/'+ id,
    method: 'get',
  })
}

export function add(params) {
  return request({
    url: '/bot',
    method: 'post',
    data: params
  })
}
export function update(params) {
  return request({
    url: '/bot',
    method: 'put',
    data: params
  })
}
export function del(idList) {
  const data = {
    idList
  }
  return request({
    url: '/bot?idList='+idList,
    method: 'delete',
    data: data
  })
}
export function getBotByGroupId(groupId) {
  return request({
    url: '/bot/list/'+groupId,
    method: 'get',
  })
}
